from myelin.rdf.bindery.ObjectTypes import LiteralTypeO, ResourceTypeO
from myelin.Ns import MYELIN, FOAF

from Resource import Resource

from ObjectTypes import \
    AgentTypeO, AgentTypeS, \
    AgentAccountTypeO, \
    GroupAgentTypeS, \
    AgentProfileTypeS

from mappings import \
    AgentAccountMap, AgentMap, \
    AgentMembershipMap, \
    PrimaryTopicMap

class Agent(Resource):
    
    ModelTypes = (AgentTypeO, AgentTypeS)
    
    RDF_BINDINGS = {
        'mPrimary_Account'      : ((MYELIN, 'primary-account'), AgentAccountTypeO, AgentMap),
        'mPrimaryTopic'         : ((FOAF, 'primaryTopic'), AgentProfileTypeS, PrimaryTopicMap),
            
        'foafNick'              : ((FOAF, 'nick'), LiteralTypeO, AgentMap),
        'foafName'              : ((FOAF, 'name'), LiteralTypeO, AgentMap),
        'foafMbox'              : ((FOAF, 'mbox'), ResourceTypeO, AgentMap),
        
        'foafMember'            : ((FOAF, 'member'), GroupAgentTypeS, AgentMembershipMap),
            
    }

    
CLASS_TYPES = {
    MYELIN + 'Agent' : Agent,
}